﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<%@ Import Namespace="BPM.Entity" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    提交的进货单
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        var list = ViewData["list"] as PagedList<PurchaseOrder>;
    %>
    <%
        if (list == null || list.Count == 0)
        {
    %>
    <div>
        没有您提交的待审核的进货单!</div>
    <%
        }
        else
        {
    %>
    <table class="altTable" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <td>
                    进货单条码
                </td>
                <td>
                    提交时间
                </td>
                <td>
                    物料数
                </td>
                <td>
                    状态
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </thead>
        <tbody>
            <%
                foreach (var item in list)
                { %>
            <tr>
                <td>
                    <%= item.Barcode.Number %>
                </td>
                <td>
                    <%= item.CreatedTime.ToShortDateString() %>
                </td>
                <td>
                    <%= item.ItemList.Sum(p => p.Amount).ToString() %>
                </td>
                <td>
                    <%= item.IsApproved ? "审核通过" : "审核中" %>
                </td>
                <td>
                    <%= Html.ActionLink("查看", "MyPurchaseOrder", new { Id = item.Id })%>
                </td>
            </tr>
            <%
                } %>
        </tbody>
    </table>
    <%
        }
    %>
    <%=
        Html.Pager(list, new PagerOptions
                {
                    PageIndexParameterName = "page",
                    FirstPageText = "首页",
                    LastPageText="尾页", 
                    NextPageText="下页", 
                    PrevPageText="上页"
                }
        ) 
    %>
</asp:Content>
